/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package view.GUI.sidepanels;

import java.awt.Color;
import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;
import view.GUI.LabelReader;

/**
 *
 * @author Arfeniel
 */
public class ColorRenderer extends JLabel implements TableCellRenderer {
    public ColorRenderer() {
        setOpaque(true); 
    }

    public Component getTableCellRendererComponent(JTable table, Object color, boolean isSelected, boolean hasFocus, int row, int column) {
        Color newColor = (Color)color;
        setBackground(newColor);
        setToolTipText(LabelReader.getInstance().getString("Value")+": "
                                     + newColor.getRed() + ", "
                                     + newColor.getGreen() + ", "
                                     + newColor.getBlue());
        return this;
    }
}


